<template>
  <div>
    <div class="item" v-for="(item, index) in list" :key="index">
      <div class="item-title border-bottom">
        <span class="item-title-icon"></span>{{item.title}}
        <div class="item-title-desc">
          {{item.desc}}
          <button class="desc-btn right">预定</button>
        </div>
      </div>
      <div v-if="item.children" class="item-children">
        <DetailList :list="item.children"></DetailList>
        <div class="item-children-info">
          <div class="left">
            刷证件入园
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  }
}
</script>

<style scoped>
  .item-title{
    line-height: .8rem;
    font-size: .32rem;
    padding: 0 .2rem;
  }
  .item-title-icon{
    position: relative;
    left: .06rem;
    top: .06rem;
    display: inline-block;
    width: .36rem;
    height: .36rem;
    background: url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -.45rem no-repeat;
    margin-right: .1rem;
    background-size: .4rem 3rem;
  }
  .item-title-desc{
    color: #616161;
  }
  .item-children{
    padding: 0 .2rem;
    box-sizing: border-box;
  }
  .item-children-info{
    overflow: hidden;
    width: 100%;
    height: .6rem;
    font-size: .32rem;
    color: #616161;
  }
  .left{
    padding: 0 .6rem;
    width: 70%;
    float: left;
  }
  .right{
    position: absolute;
    right: .1rem;
    width: 30%;
    float: right;
  }
  .desc-btn{
    height: .6rem;
    color: #fff;
    font-size: .28rem;
    line-height: .6rem;
    border-radius: .08rem;
    background-image: linear-gradient(130deg,#ffab1e 37%,#ff8c12 100%);
  }
</style>
